﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Celltest
{
    class GUI
    {
        public GUI()
        {
        }

        public char Char(byte b)
        {
            return Encoding.GetEncoding(437).GetChars(new byte[] { b })[0];
        }

        public void WriteAt(byte b, Position pos)
        {
            var c = Char(b);
            try
            {
                Console.SetCursorPosition(pos.X, pos.Y);
                Console.Write(c);
                Console.SetCursorPosition(pos.X, pos.Y);
            }
            catch (ArgumentOutOfRangeException e)
            {

                Console.Write(e);
                Console.SetCursorPosition(1, 0);
                Console.Clear();

                //throw;

            }

            //Console.Write(c);

        }
        public void WriteTextAt(string Text, Position pos)
        {
            Console.SetCursorPosition(pos.X, pos.Y);
            Console.Write(Text);
        }
    }
}
